package org.cmind.soap.android.envelope;

import java.util.List;

import org.cmind.soap.android.Attribute;
import org.cmind.soap.android.ComplexSoapObject;

/**
 * 
 * @author marcin
 *
 */
public abstract class EnvelopeBuilder {

    public final Envelope createEnvelope() {
        Envelope envelope = new Envelope(getNamespace(), this);
        envelope.setBody(createBody());
        envelope.setAttributes(createAttibutes());
        return envelope;
    }

    abstract ComplexSoapObject createBody();

    abstract ComplexSoapObject createHeader();

    abstract List<Attribute> createAttibutes();

    abstract String getNamespace();
}
